starknet-types-core
Core types representation for Starknet.
Overview
The starknet-types-core
crate provides:
- The universal
Felt
(Field Element) type for Cairo and STARK proofs. It was created to reduce the fragmentation in the Starknet Rust ecosystem by providing a standardized representation of theFelt
type.
Features
Always on
- Standardized
Felt
type: Simplify your codebase by using our standardizedFelt
type. Optimized for performance: TheFelt
type has been optimized for high-performance applications. - No_std support ✅
Serde
- Provides a Serialization and Deserialization implementations for the
Felt
type - No_std support ✅
Parity Scale Codec
- Provides Serialization and Deserialization implementations for the
Felt
type within the Parity serialization framework - No_std support ✅
Arbitrary
- Provides an Arbitrary implementations for the
Felt
type
Curve
- Add the
AffinePoint
andProjectivePoint
structs, which represent points on the Stark curve for performing elliptic curve operations. - No_std support ✅
Hash
- Implements Pedersen hashing for Felts and Felts array
Examples
Here are some examples of how to use the starknet-types-core
types:
let felt = from;
let projective_point = new;
let affine_point = new.unwrap;
Usage
Include starknet-types-core
in your library by adding the following to your Cargo.toml
:
[]
= { = "0.0.3", = "https://github.com/starknet-io/types-rs", = false, = [
"alloc",
"serde",
"arbitrary",
"curve",
"hash",
] }
Build from source
Clone the repository and navigate to the starknet-types-core directory. Then run:
Testing
Clone the repository and navigate to the starknet-types-core directory. Then run:
Contributing
Contributions are welcome! Please read our contributing guidelines for more information.
License
This repository is licensed under the MIT License, see LICENSE for more information.